function drawTenTraitsAgeChart(traitName){
    var _tenTraitsAge = echarts.init(document.getElementById('tenTraitsAgeChart'));

        var color = ['#67ADB7','#F5ADB8'];
        var tooltip = {
                trigger: 'axis',
            };
            var grid = {
                top: '2%',
                left: '3%',
                right: '15%',
                bottom: '10%',
                containLabel: true
            };
            var legend = {
                show: true,
                data: ['神经性', '外倾性', '开放性', '宜人性', '尽责性'],
                textStyle: {
                    color: '#000'
                },
                orient: 'vertical',
                left: 'center',
                right: 'auto',
                top: 'bottom',
                width: 20,
                height: 20,
                icon: 'circle'

            };
            var xAxis = [
                {
                    type: 'category',
                    boundaryGap: false,
                    data: ['20岁以下', '20岁到29岁', '30岁到39岁', '40岁到49岁', '50岁到59岁', '60岁以上'],
                    axisLabel: {
                        color: '#000',
                        fontSize: 12
                    }
                }
            ];
            var yAxis = [
                {
                    shou: true,
                    type: 'value',
                    max: 4.0,
                    min: 2,
                    interval: 0.2,
                    axisLabel: {
                        color: '#000',
                        fontSize: 12
                    }
                }
            ];

            option1 = {
                color: color,
                tooltip: tooltip,
                grid: grid,
                legend: legend,
                xAxis: xAxis,
                yAxis: yAxis,
                series: [
                    {
                        name: '焦虑',
                        type: 'line',
                        data: [ 2.90,  2.86, 2.79, 2.68, 2.56, 2.72]
                    },
                    {
                        name: '抑郁',
                        type: 'line',
                        data: [ 2.68,  2.69, 2.57, 2.38, 2.36, 2.54]
                    }
                ]
            };

            option2 = {
                color: color,
                tooltip: tooltip,
                grid: grid,
                legend: legend,
                xAxis: xAxis,
                yAxis: yAxis,
                series: [
                    {
                        name: '自信',
                        type: 'line',
                        data: [ 3.01,  3.01, 3.13, 3.25, 3.23, 3.19]
                    },
                    {
                        name: '活跃',
                        type: 'line',
                        data: [ 3.581,  3.45, 3.46, 3.48, 3.51, 3.20]
                    }
                ]
            };

            option3 = {
                color: color,
                tooltip: tooltip,
                grid: grid,
                legend: legend,
                xAxis: xAxis,
                yAxis: yAxis,
                series: [
                    {
                        name: '审美',
                        type: 'line',
                        data: [ 3.39,  3.32, 3.11, 3.06, 3.17, 3.02]
                    },
                    {
                        name: '创意',
                        type: 'line',
                        data: [ 3.30,  3.24, 3.15, 3.16, 3.11, 2.98]
                    }
                ]
            };

            option4 = {
                color: color,
                tooltip: tooltip,
                grid: grid,
                legend: legend,
                xAxis: xAxis,
                yAxis: yAxis,
                series: [
                    {
                        name: '利他',
                        type: 'line',
                        data: [ 3.62,  3.60, 3.66, 3.80, 3.80, 3.80]
                    },
                    {
                        name: '顺从',
                        type: 'line',
                        data: [ 3.761,  3.73, 3.75, 3.88, 3.83, 3.7]
                    }
                ]
            };

            option5 = {
                color: color,
                tooltip: tooltip,
                grid: grid,
                legend: legend,
                xAxis: xAxis,
                yAxis: yAxis,
                series: [
                    {
                        name: '条理',
                        type: 'line',
                        data: [ 2.73,  2.88, 3.00, 3.21, 3.14, 3.10]
                    },
                    {
                        name: '自律',
                        type: 'line',
                        data: [ 3.24,  3.31, 3.45, 3.66, 3.64, 3.69]
                    }
                ]
            };

            if(traitName == '焦虑与抑郁')
                _tenTraitsAge.setOption(option1);
            else if(traitName == '自信与活跃')
                _tenTraitsAge.setOption(option2);
            else if(traitName == '审美与创意')
                _tenTraitsAge.setOption(option3);
            else if(traitName == '利他与顺从')
                _tenTraitsAge.setOption(option4);
            else if(traitName == '条理与自律')
                _tenTraitsAge.setOption(option5);
 
    // // 3. 让图表跟随屏幕自动的去适应
    // window.addEventListener("resize", function () {
    //     myChart1.resize();
    //     myChart2.resize();
    //     myChart3.resize();
    //     myChart4.resize();
    //     myChart5.resize();
    // }); 
};
